package router

import (
	"github.com/gin-gonic/gin"
	"seat-service/api"
)

type carouselRouter struct {
}

func (*carouselRouter) CarouselRouterGroup(Router *gin.RouterGroup) *gin.RouterGroup {
	carousel := Router.Group("carousel")
	carouselApi := api.CarouselApi{}
	{
		//新增数据
		carousel.POST("add", carouselApi.AddCarousel)
		//删除 只有待发布状态可以删除
		carousel.GET("del", carouselApi.DelCarousel)
		//修改数据，修改序号，优先级，图片，状态
		carousel.POST("update", carouselApi.UpdateCarousel)
		//显示所有数据
		carousel.GET("", carouselApi.QueryCarousel)
		//根据标题显示数据
		carousel.GET("query_title", carouselApi.QueryCarouselByTitle)
		//修改发布状态
		carousel.POST("publish", carouselApi.PublishStatusCarousel)
		//上传图片
		carousel.POST("upload_image", carouselApi.UploadImage)

	}
	return carousel
}

func (*carouselRouter) AppRouterGroup(router *gin.RouterGroup) *gin.RouterGroup {
	carousel := router.Group("carousel")
	carouselApi := api.CarouselApi{}
	{
		carousel.GET("get", carouselApi.Get) // 获取所有的轮播图
	}
	return carousel
}
